package com.augurit.gis.casequery;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import net.sf.json.JSONArray;

import com.augurit.gis.common.dao.CommonDAO;
import com.augurit.gis.common.util.SQLUtil;
import com.augurit.gzcgwsp.qyzz.entity.YwRqQyzzInfo;

public class CaseQueryDAO extends CommonDAO {

	public CaseQueryDAO() {
	}
	
	@SuppressWarnings("unchecked")
	public List<YwRqQyzzInfo> getList(String tableName,String accept_no){
		String sql  = "select * from "+ tableName +" where accept_no='"+accept_no+"'";
		System.out.println(sql);
		try {
			return commonSearch(buildSQL(0, 20, sql),com.augurit.gis.common.dao.ConnectionFactory.getMisConnection());
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List resultSetToList(ResultSet set) throws SQLException {
		List<YwRqQyzzInfo> itemList = new ArrayList<YwRqQyzzInfo>();
		while(set.next()){
			YwRqQyzzInfo item = new YwRqQyzzInfo();
			item.setAcceptNo(set.getString("accept_no").trim());
			item.setSqdw(set.getString("sqdw").trim());
			//item.setCbyw(cbyw)
			//item.setAcceptNo("accept_no");
			//item.setIeiName("iei_name");
			itemList.add(item);
		}
		return itemList;
	}
}
